package com.lagou.app;

import com.lagou.dao.PhoneDao;
import com.lagou.entity.Phone;
import org.junit.Test;

import java.sql.SQLException;
import java.util.List;

public class TestPhoneDao {

    PhoneDao phoneDao;

    @Test
    public void testfindPhone() throws SQLException {

        // 查询价格高于2000， 生产日期于2019年之前的手机信息
        List<Phone> list = phoneDao.findPhone(2000, "2019-01-01");

        for (Phone phone : list) {
            System.out.println(phone);
        }
    }

    @Test
    public void testfindPhoneByColor() throws SQLException {

        // 查询颜色为白色的手机
        List<Phone> list = phoneDao.findPhoneByColor("白色") ;

        for (Phone phone : list) {
            System.out.println(phone);
        }
    }
}

